Element

Overview

A Member "element" is a specific item from an attribute (or column) that was selected in the query. Use the rendered element selections to understand and draw the visual.

  • From version: 2020.20

Properties

caption

caption: string

Member's plain text caption.

Console.log("current element : " + element.caption);

isSelected

isSelected: boolean

Returns true if the current element is selected in the UI.

Const isElementSelected = element.isSelected;

level

level: number

Returns the member's level index in a multi-level hierarchy. Especially useful when the visual takes the hierarchical nature of the results into account.

Const memberLevel = element.level;

parentChip

parentChip: Chip

The "chip" object that member element belongs too.

const parentChip = element.parentChip;
Console.log("current element parent chip is " + parentChip.caption);

uniqueName

uniqueName: string

Member's Unique name.

const elementUniqueName = element.uniqueName;

Methods

hideTooltip

hideTooltip ( event : MouseEvent<any, MouseEvent>): void

Hide the tooltip for the current element. Typically used on when the mouse leaves element's visual representation.

const element = cvApi2.resultSet.data.getCurrentTrellisData().datapoints[0].Coordinates[0];

svgElement
.append("path")
.on("mouseout", function () { element.hideTooltip(); });

Parameters

  • event:MouseEvent<any, MouseEvent>

    DOM mouse event object for the tooltip to generate from.

Returns void

select

select (): void

Selects the current element. May be used to trigger a user action on the custom visual.

element.select();
Returns void

showContextMenu

showContextMenu ( event : MouseEvent<any, MouseEvent>): void

Show the 'elements' context menu for the selected elements. Provides a method to trigger the member element context menu from Pyramid. Showing the context menu gives the user more options and interactions between the visual and the data.

const element = cvApi2.resultSet.data.getCurrentTrellisData().datapoints[0].Coordinates[0];

svgElement
.append("path")
.on("contextmenu", function () { element.showContextMenu(d3.selection.event); });

Parameters

  • event:MouseEvent<any, MouseEvent>

    DOM mouse event object for the context menu to generate from.

Returns void

showTooltip

showTooltip ( event : MouseEvent<any, MouseEvent>): void

Displays the tooltip associated with the current element. Typically used on when the mouse hovers over an element's visual representation.Tooltips show other useful information about an element.

const element = cvApi2.resultSet.data.getCurrentTrellisData().datapoints[0].Coordinates[0];

svgElement
.append("path")
.on("mouseover", function () { element.showTooltip(d3.selection.event); });

Parameters

  • event:MouseEvent<any, MouseEvent>

    DOM mouse event object for the tooltip to generate from.

Returns void